-
-
Notifications
You must be signed in to change notification settings - Fork 28
fix: no-invalid-properties false positives for var() in functions #227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: no-invalid-properties false positives for var() in functions #227
Conversation
Can you check the test failures? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have one false positive, can you please check?
/* eslint css/no-invalid-properties: "error" */
:root {
--dynamic-width: calc(20px + 10px);
--dynamic-width-2: calc(var(--dynamic-width) + 10px);
}
.div { width: calc(100% - var(--dynamic-width)); } // ok
.div2 { width: calc(100% - var(--dynamic-width-2)); } // Error Unknown property 'width' found
@snitin315 I looked into it but wasn't able to reproduce the false positive. To be thorough, I've added a test case for this scenario, and it's currently passing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unable to reproduce that anymore.
LGTM, thanks!
Leavnig it open for 2nd review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Nice work!
Prerequisites checklist
What is the purpose of this pull request?
This PR fixes a regression in the
no-invalid-properties
rule where it incorrectly reports for valid CSS properties containingvar()
usage within functions likecalc()
.What changes did you make? (Give an overview)
Related Issues
Fixes #223
Is there anything you'd like reviewers to focus on?